// 解说的操作api
import request from "@/utils/request.js"

// 报满
export function selectGame(id: string) {
    return request({
        url: "/api/v1/com",
        method: "post",
        params: {
            gameid: id
        }
    })
}
// 获取我的场次
export function getMyGame() {
    return request({
        url: "/api/v1/com/my",
        method: "post"
    })
}
// 获取个人信息
export function getUserInfo() {
    return request<{
        chinaname?: string;
        name?: string;
        email?: string;
        roles?: string[];
        officium?:string;
        integral?:number | null;
        base64?: string;
    }>({
        url: "/api/v1/user",
        method: "get"
    })

}
// 积分榜单
export function getRanking(){
    return request({
      url:"/api/v1/com/Integral/ranking",
      method:"POST"
    })
}
// 取消选班
export function deleteGame(id: string) {
    return request({
        url: "/api/v1/com",
        method: "delete",
        params: {
            gameid: id
        }
    })
}
// 获取我的解说场次
export function getMyCount() {
    return request({
        url: "/api/v1/com",
        method: "get"
    })
}
// 设置积分模式
export function openPoints(){
    return request({
        url:"/api/v1/open/points",
        method:"PUT"
    })
}
interface comData{
    com_Email?:string,
    idv_id?:string,
    introduction?:string,
    com_qq?:string
}
// 提交解说申请单
export function submitForm(data:comData){
   return request({
      url:"/api/v1/comform",
      method:"post",
      data
   })
}
// 展示解说报名列表
export function getEnrollList(page:number,limit:number){
   return request({
    url:"/api/v1/admin/comform",
    method:"get",
    params:{
        page,
        page_long:limit
    }
   })
}
// 设置解说通过考验
export function setPass(id:number){
   return request({
     url:"/api/v1/admin/comform_ok",
     method:"get",
     params:{
        comform_id:id
     }
   })
}
// 不通过
export function setFail(id:number){
    return request({
        url:"/api/v1/admin/comform_no",
        method:"get",
        params:{
            comform_id:id
         }
    })
}